const context = {
    // get query() {
    //     return this.request.query
    // }
}

function defineGetter(target, key) {
    // 注意this指向，这里不能用箭头函数
    context.__defineGetter__(key, function () {
        return this[target][key];
    })
}
function defineSetter(target, key) {
    context.__defineSetter__(key, function (value) {
        this[target][key] = value
    })
}
defineGetter('request', 'query')
defineGetter('request', 'path')
defineGetter('response', 'body')
defineSetter('response', 'body')
module.exports = context